/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package group6renderer.renderernode;

import group6renderer.Display;

/**
 *
 * @author yiannis
 */
public class TextNode extends LeafNode {
    
    private String text;
	
	public TextNode(String theText)
    {
	text = theText;
	name="text";

    }

    @Override
    public void drawNode(Display disp)
    {
    	disp.addText(text);
    }

    @Override
    public boolean hasClosing()
    {
	  return false;
    }

    @Override
    public TreeNode copy()
    {
	return new TextNode("");
    }

    public String getText()
    {
    	return text;
    }


    public boolean checkForLetters(String s)
    {
    	char []s2=s.toCharArray();
    	
    	for (int i=0;i<s2.length;i++)
    		
    		if (Character.isLetterOrDigit(s2[i]))
    		{
    			return true;
    		}
    	return false;
    }
}
